<?php
$nowdate=date("Y-m-d");
$lockFile='./include/getall.lock';
if(!file_exists($lockFile)||(date("Y-m-d",filemtime($lockFile))!=$nowdate)){
	set_time_limit(0);
	ignore_user_abort(true); 
	touch($lockFile);
	$cities=$db->select("select `AreaID`,`WeatherCode` from {$table_top}weather");
	foreach($cities as $v){
		$tem=$db->getone("select `Update` from {$table_top}weatherlog where `AreaID`='{$v['AreaID']}' and `Update`='{$nowdate}'");
		!$tem['Update']&&$db->insert("insert into {$table_top}weatherlog (`AreaID`,`Update`) values ('{$v['AreaID']}','{$nowdate}')");
		GetWeatherAll($v['AreaID'],$v['WeatherCode']);
	}
}
?>